package com.zdkj.subway.stm.util;/**
 * @author 陈博
 * @date 2020/2/27 0027 23:20
 */

import com.zdkj.subway.stm.dto.out.SwStInvoiceBalanceDTO;
import com.zdkj.subway.stm.entity.*;
import lombok.experimental.UtilityClass;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;

/**
 * @program: zdkj
 *
 * @description: 自定义sql 分页查询条件 map类
 *
 * @author: chen
 *
 * @create: 2020-02-27 23:20
 **/
@UtilityClass
public class SelMapUtils {

    /**
     * 删除标志  0  未删除
     */
    private final Integer DEL_FLAG_0=0;

    /**
     * 获取当前时间yyyyMMddHHmmss格式字符串
     * @return
     */
    public String getDatetimeNowFormatter(){
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        return  formatter.format(LocalDateTime.now());
    }


    public Map<String,Object> getSwStConductorFareConsolidationNoticeMap(SwStConductorFareConsolidationNotice use){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.NOTICE_TYPE",use.getNoticeType());
            put("a.NOTICE_STATUS",use.getNoticeStatus());
            put("a.NOTICE_TIME",use.getNoticeTime());
            put("a.LINE_CODE",use.getLineCode());
            put("a.STATION_CODE",use.getStationCode());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }
    public Map<String,Object> getSwStOthreFareMap(SwStOtherFare use){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.SEND_DATE",use.getEntryName());
            put("a.RECIPIENT_NAME",use.getEntryDate());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }

    public Map<String,Object> getSwStInvoiceUseMap(SwStInvoiceUse use){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.SEND_DATE",use.getSendDate());
            put("a.RECIPIENT_NAME",use.getRecipientName());
            put("a.INVOICE_TYPE",use.getInvoiceType());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }

    public Map<String,Object> getSwStInvoiceBalanceMap(SwStInvoiceBalanceDTO stInvoiceBalanceDTO){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.SEND_DATE",stInvoiceBalanceDTO.getBalanceDate());
            put("a.INVOICE_TYPE",stInvoiceBalanceDTO.getInvoiceType());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }

    public Map<String,Object> getSwStCycleNoticeMap(SwStCycleNotice swStCycleNotice){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }
    public Map<String,Object> getSwStCycleMap(SwStCycle swStCycle){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            /**
             * 此处待完善   不确定时间字段根据？查询
             */
            if (swStCycle.getInLineCode()!=null){
                put("a.IN_LINE_CODE",swStCycle.getInLineCode());
            }
            if (swStCycle.getOutLineCode()!=null){
                put("a.OUT_LINE_CODE",swStCycle.getOutLineCode());
            }
            if (swStCycle.getInStationCode()!=null){
                put("a.IN_STATION_CODE",swStCycle.getInStationCode());
            }
            if (swStCycle.getOutStationCode()!=null){
                put("a.OUT_STATION_CODE",swStCycle.getOutStationCode());
            }
            if (swStCycle.getInTime()!=null){
                put("a.IN_TIME",swStCycle.getInTime());
            }
            if (swStCycle.getOutTime()!=null){
                put("a.OUT_TIME",swStCycle.getOutTime());
            }
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }
    public Map<String,Object> getSwStCycleApplyMap(SwStCycleApply swStCycleApply){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.APPLY_TIME",swStCycleApply.getApplyTime());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }


    public Map<String,Object> getSwStApplyNetworkCheckPassengerAffairsMap(SwStApplyNetworkCheckPassengerAffairs sw){
        HashMap<String, Object> mp = new HashMap<String, Object>(16){{
            put("a.TRANSACTION_TYPE",sw.getTransactionType());
            put("a.CARD_NUMBER",sw.getCardNumber());
            put("a.DEL_FLAG",DEL_FLAG_0);
        }};
        return mp;
    }




}
